<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html class="">
<head>
	
	<meta name="author" content="蓝凌科技">
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />

	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm.min.css">	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm-extend.min.css">	
	
	<title>帮工小哥</title>
	
	<script type="text/javascript">
	    var _root = '<?php echo ($_site_url); echo U(' / ');?>', _controller = '<?php echo ($_controller); ?>';
	</script>
	
	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/order.css">
	<style>
		body,li,p,ul { 
		    margin: 0;
		    padding: 0;
		    font: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif;
		}
		ul, li, ol { list-style: none; }
		/* 重置文本格式元素 */
		a { text-decoration: none; cursor: pointer; color:#333333; font-size:14px;}
		a:hover { text-decoration: none; }
		.clearfix::after{ display:block; content:''; height:0; overflow:hidden; clear:both;} 
		/*星星样式*/
		.content{ width:600px; margin:0 auto; padding-top:20px;}
		.title{ font-size:14px; background:#dfdfdf; padding:10px; margin-bottom:10px;}
		.block{ width:100%; margin:0 0 20px 0; padding-top:10px; padding-left:50px; line-height:21px;}
		.block .star_score{ float:left;}
		.star_list{height:21px;margin:50px; line-height:21px;}
		.block p,.block .attitude{ padding-left:20px; line-height:21px; display:inline-block;}
		.block p span{ color:#C00; font-size:16px; font-family:Georgia, "Times New Roman", Times, serif;}
		.star_score { background:url(/Public/Api/images/stark2.png); width:160px; height:21px;  position:relative; }
		.star_score a{ height:21px; display:block; text-indent:-999em; position:absolute;left:0;}
		.star_score a:hover{ background:url(/Public/Api/images/stars2.png);left:0;}
		.star_score a.clibg{ background:url(/Public/Api/images/stars2.png);left:0;}
		#starttwo .star_score { background:url(/Public/Api/images/starky.png);}
		#starttwo .star_score a:hover{ background:url(/Public/Api/images/starsy.png);left:0;}
		#starttwo .star_score a.clibg{ background:url(/Public/Api/images/starsy.png);left:0;}
		/*星星样式*/
		.show_number{ padding-left:50px; padding-top:20px;}
		.show_number li{ width:240px; border:1px solid #ccc; padding:10px; margin-right:5px; margin-bottom:20px;}
		.atar_Show{background:url(/Public/Api/images/stark2.png); width:160px; height:21px;  position:relative; float:left; }
		.atar_Show p{ background:url(/Public/Api/images/stars2.png);left:0; height:21px; width:134px;}
		.show_number li span{ display:inline-block; line-height:21px;}
	</style>
	
	


</head>
<body>
	
	
<div class="page-group">
    <div class="page page-current my-order">
        <div class="order-foot bar bar-standard bar-footer">
            <div class="content-block order-foot-block">
                <div class="row">
                    <div class="col-100">
                    	<a href="#" onclick="submit()" class="button button-big button-fill button-pay">立即点评</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
            <div class="order-detail-top">
                <div class="list-block media-list">
                    <ul>
                        <li class="order-p">
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="<?php echo ((isset($workerModel['fullpath']) && ($workerModel['fullpath'] !== ""))?($workerModel['fullpath']):'/Public/Api/images/person1.png'); ?>" alt="">
                                </div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title item-p"><?php echo ($workerModel['name']); ?></div>
                                    </div>
                                    <div class="item-subtitle">工号：<?php echo ($workerModel['eid']); ?></div>
                                    <div class="item-subtitle">工种：<?php echo get_dictionary_enum_name('profession_options', $workerModel['profession']);?></div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="order-details">
                <div id="startone" class="block clearfix">
					<div style="width: 160px;" class="star_score"></div>
			        <p style="float:left;">您的评分：<span class="fenshu"></span> 分</p>
			    </div>
                <div class="comment-details">
                    <textarea name="content" id="content" placeholder="您的点评就是小哥前进的动力，写点什么吧…"></textarea>
                    <input type="hidden" name="order_id" id="order_id" value="<?php echo ($order_id); ?>"/>
                    <input type="hidden" name="worker_id" id="worker_id" value="<?php echo ($workerModel['worker_id']); ?>"/>
                </div>
            </div>
        </div>
    </div>
</div>



	<!-- 底部
================================================== -->
<footer>
</footer>
<script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/api.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    
</script>
<script src="/Public/Api/js/zepto.min.js" type="text/javascript">
</script>
<script type="text/javascript">
//坑死人的配置项
//若不加此配置，则所有页面均使用 js 和 css 缓存
$.config = {
   	router: false
}
</script>
<script src="/Public/Api/js/sm.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/sm-extend.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/think.js" type="text/javascript">
</script>


<script src="/Public/Api/js/startScore.js" type="text/javascript"></script>
<script type="text/javascript">
scoreFun($("#startone"));

function submit(){
	var score = $(".fenshu").html();
	var content = $("#content").val();
	var target = Think.U('Worker/comment');
	var workerID = $("#worker_id").val();
	var orderID = $("#order_id").val();
	
	if(!score || isNaN(score)){
		$.toast('请为小哥打分');
		return false;
	}
	
	if(isNaN(workerID) || isNaN(orderID)){
		$.toast('参数错误，请刷新后再试');
		return false;
	}
	
	$.post(target, {'score':score, 'content':content, 'worker_id':workerID, 'order_id':orderID}, function(data){
		
		if(data.status == 1){
			$.alert('点评成功', function(){
				window.location.href = Think.U('Orders/index', 'type=4');
			});
		}else if(data.status == '-201'){
			$.confirm('身份认证已失效，请重新登录', function () {
		        window.location.href = Think.U('Public/login');
		    });
		}else if(data.status == '-1'){
			$.alert('已评价该订单，不可重复评价', function(){
				window.location.href = Think.U('Orders/index', 'type=4');
			});
		}else{
			$.toast('点评失败，请刷新后再试');
		}
	});
	
}

</script>

<!-- 用于加载js代码 -->

</body>
</html>